//
//  GiftResp.swift
//  ObjcCodable
//
//  Created by chenbo on 2025/2/10.
//

// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse the JSON, add this file to your project and do:
//
//   let giftsResp = try? newJSONDecoder().decode(GiftsResp.self, from: jsonData)

import Foundation

// MARK: - GiftsResp
@objcMembers class GiftsResp: NSObject, Codable {
    var errNo: String = "this err"
    var pid: String?
    var data: DataClass?
    var authorizeToken: String?
    var serverTime: String?
    var serverTimeMs: String?
    var clientIp: String?
    var localCacheMatch: String?
    var error: String?
    
    
    
}

/// 扩展GiftsResp的JSONCodable方法(保证在Objc中能调起下列方法)
extension GiftsResp: JSONCodable {

    static func instance(jsonObject: Any?) -> Self? {
        return JSONDecodableUtil.decode(jsonObject: jsonObject)
    }
    
    static func instance(jsonString: String?) -> Self? {
        return JSONDecodableUtil.decode(jsonString: jsonString)
    }
    
    var jsonObject: Any? {
        return JSONEncodableUtil.jsonObject(self)
    }
    
    var jsonString: String? {
        return JSONEncodableUtil.jsonString(self)
    }
}

// MARK: - DataClass
@objcMembers class DataClass: NSObject, Codable {
    var list: [List]?
    var version: String?
}

// MARK: - List
@objcMembers
@objc(List)
class List: NSObject, JSONCodable {
    var iconUrl: IconUrl?
    var name: String?
    var giftId: String?
    var memo: String?
    var discount: String?
    var memoNames: MemoNames?
    var price: String?
    var effectPreviewUrl: String?
    var effectUrl: String?
  
    static func array(from json: [Any]?) -> [Any]? {
        let res = [Self].instance(jsonObject: json)
        return res
    }
    
}

// MARK: - IconUrl
@objcMembers class IconUrl: NSObject, Codable {
    var hover: String?
    var normal: String?
}

// MARK: - MemoNames
@objcMembers class MemoNames: NSObject, Codable {
    var tw: String?
    var hk: String?
    var en: String?
    var cn: String?
}
